#
# ttkiosk - table tennis club touch screen based kiosk.
# Copyright (C) 2009  Sergey Satskiy
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA  02110-1301, USA.
#
# $Id: Keyboard.py 31 2009-10-26 04:07:07Z sergey.satskiy $
#
# Generated by PyQt4 UI code generator 4.5.4 and then customized
#


from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import SIGNAL, SLOT
import ui
from utils import debugMsg, GlobalData


class Ui_Keyboard(ui.FormBaseClass):
    def setupUi(self, Keyboard, path):
        ui.FormBaseClass.__init__(self)

        Keyboard.setObjectName("Keyboard")
        Keyboard.setWindowModality(QtCore.Qt.ApplicationModal)
        Keyboard.resize(630, 371)
        self.buttonQ = QtGui.QPushButton(Keyboard)
        self.buttonQ.setGeometry(QtCore.QRect(31, 130, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonQ.setFont(font)
        self.buttonQ.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonQ.setObjectName("buttonQ")
        self.titleLabel = QtGui.QLabel(Keyboard)
        self.titleLabel.setGeometry(QtCore.QRect(31, 10, 531, 40))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.titleLabel.setFont(font)
        self.titleLabel.setObjectName("titleLabel")
        self.userInputLineEdit = QtGui.QLineEdit(Keyboard)
        self.userInputLineEdit.setGeometry(QtCore.QRect(31, 60, 531, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.userInputLineEdit.setFont(font)
        self.userInputLineEdit.setFocusPolicy(QtCore.Qt.NoFocus)
        self.userInputLineEdit.setReadOnly(True)
        self.userInputLineEdit.setObjectName("userInputLineEdit")
        self.buttonW = QtGui.QPushButton(Keyboard)
        self.buttonW.setGeometry(QtCore.QRect(91, 130, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonW.setFont(font)
        self.buttonW.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonW.setObjectName("buttonW")
        self.buttonE = QtGui.QPushButton(Keyboard)
        self.buttonE.setGeometry(QtCore.QRect(151, 130, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonE.setFont(font)
        self.buttonE.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonE.setObjectName("buttonE")
        self.buttonR = QtGui.QPushButton(Keyboard)
        self.buttonR.setGeometry(QtCore.QRect(211, 130, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonR.setFont(font)
        self.buttonR.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonR.setObjectName("buttonR")
        self.buttonT = QtGui.QPushButton(Keyboard)
        self.buttonT.setGeometry(QtCore.QRect(271, 130, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonT.setFont(font)
        self.buttonT.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonT.setObjectName("buttonT")
        self.buttonY = QtGui.QPushButton(Keyboard)
        self.buttonY.setGeometry(QtCore.QRect(331, 130, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonY.setFont(font)
        self.buttonY.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonY.setObjectName("buttonY")
        self.buttonU = QtGui.QPushButton(Keyboard)
        self.buttonU.setGeometry(QtCore.QRect(391, 130, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonU.setFont(font)
        self.buttonU.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonU.setObjectName("buttonU")
        self.buttonI = QtGui.QPushButton(Keyboard)
        self.buttonI.setGeometry(QtCore.QRect(451, 130, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonI.setFont(font)
        self.buttonI.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonI.setObjectName("buttonI")
        self.buttonO = QtGui.QPushButton(Keyboard)
        self.buttonO.setGeometry(QtCore.QRect(511, 130, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonO.setFont(font)
        self.buttonO.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonO.setObjectName("buttonO")
        self.buttonP = QtGui.QPushButton(Keyboard)
        self.buttonP.setGeometry(QtCore.QRect(571, 130, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonP.setFont(font)
        self.buttonP.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonP.setObjectName("buttonP")
        self.buttonD = QtGui.QPushButton(Keyboard)
        self.buttonD.setGeometry(QtCore.QRect(171, 190, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonD.setFont(font)
        self.buttonD.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonD.setObjectName("buttonD")
        self.buttonG = QtGui.QPushButton(Keyboard)
        self.buttonG.setGeometry(QtCore.QRect(291, 190, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonG.setFont(font)
        self.buttonG.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonG.setObjectName("buttonG")
        self.buttonL = QtGui.QPushButton(Keyboard)
        self.buttonL.setGeometry(QtCore.QRect(531, 190, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonL.setFont(font)
        self.buttonL.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonL.setObjectName("buttonL")
        self.buttonH = QtGui.QPushButton(Keyboard)
        self.buttonH.setGeometry(QtCore.QRect(351, 190, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonH.setFont(font)
        self.buttonH.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonH.setObjectName("buttonH")
        self.buttonJ = QtGui.QPushButton(Keyboard)
        self.buttonJ.setGeometry(QtCore.QRect(411, 190, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonJ.setFont(font)
        self.buttonJ.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonJ.setObjectName("buttonJ")
        self.buttonF = QtGui.QPushButton(Keyboard)
        self.buttonF.setGeometry(QtCore.QRect(231, 190, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonF.setFont(font)
        self.buttonF.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonF.setObjectName("buttonF")
        self.buttonS = QtGui.QPushButton(Keyboard)
        self.buttonS.setGeometry(QtCore.QRect(111, 190, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonS.setFont(font)
        self.buttonS.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonS.setObjectName("buttonS")
        self.buttonA = QtGui.QPushButton(Keyboard)
        self.buttonA.setGeometry(QtCore.QRect(51, 190, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonA.setFont(font)
        self.buttonA.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonA.setObjectName("buttonA")
        self.buttonK = QtGui.QPushButton(Keyboard)
        self.buttonK.setGeometry(QtCore.QRect(471, 190, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonK.setFont(font)
        self.buttonK.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonK.setObjectName("buttonK")
        self.buttonM = QtGui.QPushButton(Keyboard)
        self.buttonM.setGeometry(QtCore.QRect(431, 250, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonM.setFont(font)
        self.buttonM.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonM.setObjectName("buttonM")
        self.buttonComma = QtGui.QPushButton(Keyboard)
        self.buttonComma.setGeometry(QtCore.QRect(491, 250, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonComma.setFont(font)
        self.buttonComma.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonComma.setObjectName("buttonComma")
        self.buttonN = QtGui.QPushButton(Keyboard)
        self.buttonN.setGeometry(QtCore.QRect(371, 250, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonN.setFont(font)
        self.buttonN.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonN.setObjectName("buttonN")
        self.buttonV = QtGui.QPushButton(Keyboard)
        self.buttonV.setGeometry(QtCore.QRect(251, 250, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonV.setFont(font)
        self.buttonV.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonV.setObjectName("buttonV")
        self.buttonB = QtGui.QPushButton(Keyboard)
        self.buttonB.setGeometry(QtCore.QRect(311, 250, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonB.setFont(font)
        self.buttonB.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonB.setObjectName("buttonB")
        self.buttonPoint = QtGui.QPushButton(Keyboard)
        self.buttonPoint.setGeometry(QtCore.QRect(551, 250, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonPoint.setFont(font)
        self.buttonPoint.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonPoint.setObjectName("buttonPoint")
        self.buttonX = QtGui.QPushButton(Keyboard)
        self.buttonX.setGeometry(QtCore.QRect(131, 250, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonX.setFont(font)
        self.buttonX.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonX.setObjectName("buttonX")
        self.buttonC = QtGui.QPushButton(Keyboard)
        self.buttonC.setGeometry(QtCore.QRect(191, 250, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonC.setFont(font)
        self.buttonC.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonC.setObjectName("buttonC")
        self.buttonZ = QtGui.QPushButton(Keyboard)
        self.buttonZ.setGeometry(QtCore.QRect(71, 250, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonZ.setFont(font)
        self.buttonZ.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonZ.setObjectName("buttonZ")
        self.buttonSpace = QtGui.QPushButton(Keyboard)
        self.buttonSpace.setGeometry(QtCore.QRect(151, 310, 311, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.buttonSpace.setFont(font)
        self.buttonSpace.setFocusPolicy(QtCore.Qt.NoFocus)
        self.buttonSpace.setObjectName("buttonSpace")
        self.deleteButton = QtGui.QPushButton(Keyboard)
        self.deleteButton.setGeometry(QtCore.QRect(571, 60, 50, 50))
        self.deleteButton.setFocusPolicy(QtCore.Qt.NoFocus)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(path + "clear_left.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.deleteButton.setIcon(icon)
        self.deleteButton.setIconSize(QtCore.QSize(48, 48))
        self.deleteButton.setObjectName("deleteButton")
        self.shiftButton = QtGui.QPushButton(Keyboard)
        self.shiftButton.setGeometry(QtCore.QRect(11, 250, 50, 50))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.shiftButton.setFont(font)
        self.shiftButton.setFocusPolicy(QtCore.Qt.NoFocus)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(path + "up.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.shiftButton.setIcon(icon1)
        self.shiftButton.setIconSize(QtCore.QSize(48, 48))
        self.shiftButton.setObjectName("shiftButton")
        self.okButton = QtGui.QPushButton(Keyboard)
        self.okButton.setGeometry(QtCore.QRect(490, 310, 111, 50))
        self.okButton.setFocusPolicy(QtCore.Qt.NoFocus)
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap(path + "apply.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.okButton.setIcon(icon2)
        self.okButton.setIconSize(QtCore.QSize(48, 48))
        self.okButton.setObjectName("okButton")
        self.cancelButton = QtGui.QPushButton(Keyboard)
        self.cancelButton.setGeometry(QtCore.QRect(10, 310, 111, 50))
        self.cancelButton.setFocusPolicy(QtCore.Qt.NoFocus)
        icon3 = QtGui.QIcon()
        icon3.addPixmap(QtGui.QPixmap(path + "close.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.cancelButton.setIcon(icon3)
        self.cancelButton.setIconSize(QtCore.QSize(48, 48))
        self.cancelButton.setObjectName("cancelButton")

        self.retranslateUi(Keyboard)
        QtCore.QMetaObject.connectSlotsByName(Keyboard)

    def retranslateUi(self, Keyboard):
        Keyboard.setWindowTitle(QtGui.QApplication.translate("Keyboard", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonQ.setText(QtGui.QApplication.translate("Keyboard", "Q", None, QtGui.QApplication.UnicodeUTF8))
        self.titleLabel.setText(QtGui.QApplication.translate("Keyboard", "First name", None, QtGui.QApplication.UnicodeUTF8))
        self.userInputLineEdit.setText(QtGui.QApplication.translate("Keyboard", "Sergey Satskiy", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonW.setText(QtGui.QApplication.translate("Keyboard", "W", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonE.setText(QtGui.QApplication.translate("Keyboard", "E", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonR.setText(QtGui.QApplication.translate("Keyboard", "R", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonT.setText(QtGui.QApplication.translate("Keyboard", "T", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonY.setText(QtGui.QApplication.translate("Keyboard", "Y", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonU.setText(QtGui.QApplication.translate("Keyboard", "U", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonI.setText(QtGui.QApplication.translate("Keyboard", "I", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonO.setText(QtGui.QApplication.translate("Keyboard", "O", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonP.setText(QtGui.QApplication.translate("Keyboard", "P", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonD.setText(QtGui.QApplication.translate("Keyboard", "D", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonG.setText(QtGui.QApplication.translate("Keyboard", "G", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonL.setText(QtGui.QApplication.translate("Keyboard", "L", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonH.setText(QtGui.QApplication.translate("Keyboard", "H", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonJ.setText(QtGui.QApplication.translate("Keyboard", "J", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonF.setText(QtGui.QApplication.translate("Keyboard", "F", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonS.setText(QtGui.QApplication.translate("Keyboard", "S", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonA.setText(QtGui.QApplication.translate("Keyboard", "A", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonK.setText(QtGui.QApplication.translate("Keyboard", "K", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonM.setText(QtGui.QApplication.translate("Keyboard", "M", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonComma.setText(QtGui.QApplication.translate("Keyboard", ",", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonN.setText(QtGui.QApplication.translate("Keyboard", "N", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonV.setText(QtGui.QApplication.translate("Keyboard", "V", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonB.setText(QtGui.QApplication.translate("Keyboard", "B", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonPoint.setText(QtGui.QApplication.translate("Keyboard", ".", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonX.setText(QtGui.QApplication.translate("Keyboard", "X", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonC.setText(QtGui.QApplication.translate("Keyboard", "C", None, QtGui.QApplication.UnicodeUTF8))
        self.buttonZ.setText(QtGui.QApplication.translate("Keyboard", "Z", None, QtGui.QApplication.UnicodeUTF8))


class Keyboard(QtGui.QDialog, Ui_Keyboard):
    def __init__(self, path, parent=None, f=QtCore.Qt.WindowFlags()):
        QtGui.QDialog.__init__(self, parent, f)

        self.setupUi(self, path)

        self.showEvent( None )
        self.makeConnections()
        return


    def showEvent( self, event ):
        """ reset """
        self.userInput = ""
        self.userInputLineEdit.setText( "" )
        self.cancelled = False
        self.caps = False
        return

    def makeConnections( self ):
        """ A collection of SIGNAL - SLOT connections """

        self.connect( self.buttonQ, SIGNAL("clicked()"), self.buttonQClicked )
        self.connect( self.buttonW, SIGNAL("clicked()"), self.buttonWClicked )
        self.connect( self.buttonE, SIGNAL("clicked()"), self.buttonEClicked )
        self.connect( self.buttonR, SIGNAL("clicked()"), self.buttonRClicked )
        self.connect( self.buttonT, SIGNAL("clicked()"), self.buttonTClicked )
        self.connect( self.buttonY, SIGNAL("clicked()"), self.buttonYClicked )
        self.connect( self.buttonU, SIGNAL("clicked()"), self.buttonUClicked )
        self.connect( self.buttonI, SIGNAL("clicked()"), self.buttonIClicked )
        self.connect( self.buttonO, SIGNAL("clicked()"), self.buttonOClicked )
        self.connect( self.buttonP, SIGNAL("clicked()"), self.buttonPClicked )
        self.connect( self.buttonA, SIGNAL("clicked()"), self.buttonAClicked )
        self.connect( self.buttonS, SIGNAL("clicked()"), self.buttonSClicked )
        self.connect( self.buttonD, SIGNAL("clicked()"), self.buttonDClicked )
        self.connect( self.buttonF, SIGNAL("clicked()"), self.buttonFClicked )
        self.connect( self.buttonG, SIGNAL("clicked()"), self.buttonGClicked )
        self.connect( self.buttonH, SIGNAL("clicked()"), self.buttonHClicked )
        self.connect( self.buttonJ, SIGNAL("clicked()"), self.buttonJClicked )
        self.connect( self.buttonK, SIGNAL("clicked()"), self.buttonKClicked )
        self.connect( self.buttonL, SIGNAL("clicked()"), self.buttonLClicked )
        self.connect( self.buttonZ, SIGNAL("clicked()"), self.buttonZClicked )
        self.connect( self.buttonX, SIGNAL("clicked()"), self.buttonXClicked )
        self.connect( self.buttonC, SIGNAL("clicked()"), self.buttonCClicked )
        self.connect( self.buttonV, SIGNAL("clicked()"), self.buttonVClicked )
        self.connect( self.buttonB, SIGNAL("clicked()"), self.buttonBClicked )
        self.connect( self.buttonN, SIGNAL("clicked()"), self.buttonNClicked )
        self.connect( self.buttonM, SIGNAL("clicked()"), self.buttonMClicked )
        self.connect( self.buttonComma, SIGNAL("clicked()"), self.buttonCommaClicked )
        self.connect( self.buttonPoint, SIGNAL("clicked()"), self.buttonPointClicked )
        self.connect( self.buttonSpace, SIGNAL("clicked()"), self.buttonSpaceClicked )

        self.connect( self.shiftButton, SIGNAL("clicked()"), self.shiftButtonClicked )
        self.connect( self.okButton, SIGNAL("clicked()"), self.okButtonClicked )
        self.connect( self.cancelButton, SIGNAL("clicked()"), self.cancelButtonClicked )
        self.connect( self.deleteButton, SIGNAL("clicked()"), self.deleteButtonClicked )
        return

    def buttonQClicked( self ):
        self.buttonPressed( 'q' )
    def buttonWClicked( self ):
        self.buttonPressed( 'w' )
    def buttonEClicked( self ):
        self.buttonPressed( 'e' )
    def buttonRClicked( self ):
        self.buttonPressed( 'r' )
    def buttonTClicked( self ):
        self.buttonPressed( 't' )
    def buttonYClicked( self ):
        self.buttonPressed( 'y' )
    def buttonUClicked( self ):
        self.buttonPressed( 'u' )
    def buttonIClicked( self ):
        self.buttonPressed( 'i' )
    def buttonOClicked( self ):
        self.buttonPressed( 'o' )
    def buttonPClicked( self ):
        self.buttonPressed( 'p' )
    def buttonAClicked( self ):
        self.buttonPressed( 'a' )
    def buttonSClicked( self ):
        self.buttonPressed( 's' )
    def buttonDClicked( self ):
        self.buttonPressed( 'd' )
    def buttonFClicked( self ):
        self.buttonPressed( 'f' )
    def buttonGClicked( self ):
        self.buttonPressed( 'g' )
    def buttonHClicked( self ):
        self.buttonPressed( 'h' )
    def buttonJClicked( self ):
        self.buttonPressed( 'j' )
    def buttonKClicked( self ):
        self.buttonPressed( 'k' )
    def buttonLClicked( self ):
        self.buttonPressed( 'l' )
    def buttonZClicked( self ):
        self.buttonPressed( 'z' )
    def buttonXClicked( self ):
        self.buttonPressed( 'x' )
    def buttonCClicked( self ):
        self.buttonPressed( 'c' )
    def buttonVClicked( self ):
        self.buttonPressed( 'v' )
    def buttonBClicked( self ):
        self.buttonPressed( 'b' )
    def buttonNClicked( self ):
        self.buttonPressed( 'n' )
    def buttonMClicked( self ):
        self.buttonPressed( 'm' )
    def buttonCommaClicked( self ):
        self.buttonPressed( ',' )
    def buttonPointClicked( self ):
        self.buttonPressed( '.' )
    def buttonSpaceClicked( self ):
        self.buttonPressed( ' ' )

    def buttonPressed( self, value ):
        if self.caps:
            value = str( value ).upper()
            self.caps = False
            self.shiftButton.setFlat( self.caps )
        else:
            value = str( value )
        self.userInput = self.userInput + value
        self.userInputLineEdit.setText( self.userInput )
        return

    def shiftButtonClicked( self ):
        self.caps = not self.caps
        self.shiftButton.setFlat( self.caps )
        return

    def okButtonClicked( self ):
        self.close()
        return

    def cancelButtonClicked( self ):
        self.cancelled = True
        self.close()
        return

    def deleteButtonClicked( self ):
        if len( self.userInput ) == 0:
            return
        self.userInput = self.userInput[ :-1 ]
        self.userInputLineEdit.setText( self.userInput )
        return

    def setLayoutGeometry( self, width, height ):
        """ updates the whole form layout size """
        return

